package com.jackson.passjava.multi.controller;


import com.jackson.passjava.multi.component.TestRollback;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author LiYuhang
 * @version 0.1
 * @application
 * @Date 2021/8/24 17:22
 */
@RestController
@Slf4j
public class TestController {


    final TestRollback testRollback;

    public TestController(TestRollback testRollback) {
        this.testRollback = testRollback;
    }


    @RequestMapping(value = {"","index"})
    public void commit() {
        try {
            testRollback.testRollBack();
        } catch (Exception e) {
            log.error("commit error :{}",e.getMessage(),e);
        }
    }
}
